﻿/*
 * Copyright (c) 2016 The ZLMediaKit project authors. All Rights Reserved.
 *
 * This file is part of ZLMediaKit(https://github.com/xia-chu/ZLMediaKit).
 *
 * Use of this source code is governed by MIT license that can be found in the
 * LICENSE file in the root of the source tree. All contributing project authors
 * may be found in the AUTHORS file in the root of the source tree.
 */

#ifndef ZLMEDIAKIT_JT1078_RTP_H
#define ZLMEDIAKIT_JT1078_RTP_H

#include "Frame.h"
#include "Rtsp/RtpCodec.h"

namespace mediakit {

/**
 * 通用 rtp解码类
 */
class JT1078RtpDecoder : public RtpCodec {
public:
    using Ptr = std::shared_ptr<JT1078RtpDecoder>;

    JT1078RtpDecoder(CodecId codec) { _codec_id = codec; }
    bool inputRtp(const RtpPacket::Ptr &rtp, bool key_pos = false) override;

private:
    void flushFrame(uint64_t stamp_ms);

private:
    bool _drop = false;
    uint16_t _last_seq = 0;
    CodecId _codec_id;
    std::string _content;
};

} // namespace mediakit
#endif // ZLMEDIAKIT_JT1078_RTP_H
